namespace HelpDesk.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class ActivityandUserProfile : DbMigration
    {
        public override void Up()
        {
            DropForeignKey("dbo.Activities", "Customer_UserId", "dbo.UserProfile");
            DropForeignKey("dbo.Activities", "SupportStaff_UserId", "dbo.UserProfile");
            DropIndex("dbo.Activities", new[] { "Customer_UserId" });
            DropIndex("dbo.Activities", new[] { "SupportStaff_UserId" });
            AddColumn("dbo.UserProfile", "IsCustomer", c => c.Boolean(nullable: false));
            AddColumn("dbo.Activities", "SubmittedBy_UserId", c => c.Int());
            AddForeignKey("dbo.Activities", "SubmittedBy_UserId", "dbo.UserProfile", "UserId");
            CreateIndex("dbo.Activities", "SubmittedBy_UserId");
            DropColumn("dbo.Activities", "Customer_UserId");
            DropColumn("dbo.Activities", "SupportStaff_UserId");
        }
        
        public override void Down()
        {
            AddColumn("dbo.Activities", "SupportStaff_UserId", c => c.Int());
            AddColumn("dbo.Activities", "Customer_UserId", c => c.Int());
            DropIndex("dbo.Activities", new[] { "SubmittedBy_UserId" });
            DropForeignKey("dbo.Activities", "SubmittedBy_UserId", "dbo.UserProfile");
            DropColumn("dbo.Activities", "SubmittedBy_UserId");
            DropColumn("dbo.UserProfile", "IsCustomer");
            CreateIndex("dbo.Activities", "SupportStaff_UserId");
            CreateIndex("dbo.Activities", "Customer_UserId");
            AddForeignKey("dbo.Activities", "SupportStaff_UserId", "dbo.UserProfile", "UserId");
            AddForeignKey("dbo.Activities", "Customer_UserId", "dbo.UserProfile", "UserId");
        }
    }
}
